package com.shuoyutech.dp.controller;


import com.shuoyutech.dp.common.base.BaseController;
import com.shuoyutech.dp.common.framework.response.Result;
import com.shuoyutech.dp.entity.HealthCheck;
import com.shuoyutech.dp.service.IHealthCheckService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author shuoyuTech
 * @since 2021-02-25
 */
@RestController
@RequestMapping("/healthCheck")
public class HealthCheckController extends BaseController {

    @Autowired
    private IHealthCheckService healthCheckService;

    @RequestMapping("/check")
    public HealthCheck checkHealth() {
        return healthCheckService.checkHealth();
    }

    @GetMapping("/checkJson")
    public Result<List<HealthCheck>> checkJson() {
        return Result.succeed(healthCheckService.checkJson());
    }

}
